1. Technical Field
The present invention relates generally to an improved data processing system and in particular to an improved method and apparatus for processing graphics data in a data processing system. Still more particularly, the present invention provides a method and apparatus for processing attributes in a data processing system.
2. Description of Related Art
Data processing systems, such as personal computers and work stations, are commonly utilized to run computer-aided design (CAD) applications, computer-aided manufacturing (CAM) applications, and computer-aided software engineering (CASE) tools. Engineers, scientists, technicians, and others employ these applications daily. These applications involve complex calculations, such as finite element analysis, to model stress in structures. Other applications include chemical or molecular modeling applications. CAD/CAM/CASE applications are normally graphics intensive in terms of the information relayed to the user. Data processing system users may employ other graphics intensive applications, such as desktop publishing applications. Generally, users of these applications require and demand that the data processing systems be able to provide extremely fast graphics information.
The processing of a graphics data stream to provide a graphical display on a video display terminal requires an extremely fast graphics system to provide a display with a rapid response. In these types of graphics systems, primitives are received for processing and display. A primitive is a graphics element that is used as a building block for creating images, such as, for example, a point, a line, an arc, a cone, or a sphere. A primitive is defined by a group of one or more vertices. An attribute is used to define how a primitive will be displayed. Attributes include, for example, line style, color, and surface texture. A vertex defines a point, an end point of an edge, or a corner of a polygon where two edges meet. Data also is associated with a vertex in which the data includes information, such as positional coordinates, colors, normals, and texture coordinates. Commands are sent to the graphics system to define how the primitives and other data should be processed for display.
With the large amounts of data and computations involved in processing graphics data, especially with three-dimensional applications, many of these computations have been offloaded from the central processing units to a graphics adapter. Within these graphics systems, a graphics pipeline located in the graphics adapter is used to process this graphics data. With a pipeline, the graphics data processing is partitioned into stages of processing elements in which processing data may be executed sequentially by separate processing elements.
Each functional stage or processing element of the pipeline processes attribute commands to update state information and vertex streams based on the current state of a particular stage or processing element. To maximize the vertex throughput in the pipeline, it is often necessary to have a capability of processing more than one vertex at a time in the pipeline. In this case, new vertices are accepted into the pipeline while others are in the midst of being processed in the pipeline. The pipeline processes each vertex in a serial fashion. In other words, a first vertex is passed from one stage to another stage down the pipeline. Other vertices are received after the first vertex and following the first vertex down the pipeline.
Problems occur when an attribute command is accepted or received at the pipeline while processing vertices. This attribute command can update the state of the stage receiving the attribute command. It is undesirable to change the state of the stage while existing vertices are being processed. The existing vertices being processed must be flushed through the stage before the attribute command can be processed. This system preserves the state of those vertices being processed when the state-altering attribute command is received. One effect of holding off processing of this type of attribute command is the latency associated with flushing vertices decreases performance in the pipeline. In cases such as immediate mode processing in which vertices and attributes can be interlaced one after the other, the performance penalty can be significant. This penalty includes sharp degradation in vertex throughput, as pipelining of vertices cannot be achieved and the vertex throughput becomes the vertex latency.
Therefore, it would be advantageous to have an improved method and apparatus for processing attribute commands in a manner in which performance in processing vertices is maximized.
The present invention provides a method and apparatus in a data processing system for processing graphics data in a processing element. A command is received. A determination is then made as to whether the command affects processing of current graphics data within the processing element. The command is sent to a subsequent processing element if the processing element is unaffected by the command. The command is held without affecting the processing element if the command affects processing of the current graphics data within the processing element until processing of the current graphics data has completed.